package com.pyf.demo.service.impl;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author pengyifeng
 * @version 1.0.0
 * @ClassName AsyncServiceImpl.java
 * @Description TODO
 * @createTime 2020年12月09日 17:47:00
 */
@Service
public class AsyncServiceImpl {

    //告诉Spring这是一个异步方法
    @Async
    public void sendMsg() {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("sendMsg");
    }
}
